<template>
  <div class="dashboard-container">
    <div class="dashboard-editor-container">
      <panel-group v-if="userType <= 3"/>
<!--      <panel-group-t />-->
      <div v-else-if="userType == 4">
        欢迎来到彩恒云商家管理系统
<!--        <OrderCount></OrderCount>-->
      </div>
      <div v-else>欢迎来到彩恒云管理系统</div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import PanelGroup from './dashboard/PanelGroup'
// import PanelGroupT from './dashboard/PanelGroupT'
import PieChart from './dashboard/BarChartT'
import BarChart from './dashboard/BarChart'
// import { count } from '@/api/visits'
import OrderCount from './dashboard/OrderCount'
import config from "../../package.json";

/**
   * 记录访问，只有页面刷新或者第一次加载才会记录
   */
// count().then(res => {
// })

export default {
  name: 'Dashboard',
  components: {
    PanelGroup,
    // PanelGroupT,
    PieChart,
    BarChart,
    OrderCount
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  data() {
    return {
      // 版本号
      userType: 0,
    };
  },
  created() {
    this.initData();
  },
  methods:{
    initData(){
       console.log('this.$store.state.user.',this.$store.state.user)
        this.userType = this.$store.state.user.user_type;
        console.log(' this.data.userType',  this.userType)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .dashboard-editor-container {
    padding: 18px 22px 22px 22px;
    background-color: rgb(240, 242, 245);

    .chart-wrapper {
      background: #fff;
      padding: 16px 16px 0;
      margin-bottom: 32px;
    }
  }
</style>
